﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommonCache.Extensions.Abstract
{
    public interface ICacheSource
    {
        T Get<T>(string key, int dbIndex = 0);

        Task<T> GetAsync<T>(string key, int dbIndex = 0);

        void Set<T>(string key, TimeSpan? time, int dbIndex = 0);

        Task SetAsync<T>(string key, TimeSpan? time, int dbIndex = 0);



        T HashGet<T>(string key, string field, int dbIndex = 0);

        Task<T> HashGetAsync<T>(string key, string field, int dbIndex = 0);

        void HashSet<T>(string key, IDictionary<string, T> kvs, TimeSpan? time, int dbIndex = 0);

        Task HashSetAsync<T>(string key, IDictionary<string, T> kvs, TimeSpan? time, int dbIndex = 0);




    }
}